<template>
  <div>
    <button @click="getData">请求数据</button>
  </div>
</template>

<script>
import axios from "axios";
export default {
  name: "App",
  methods: {
    getData() {
      axios
        .get("/api/students")
        .then((res) => {
          console.log("请求成功", res.data);
        })
        .catch((err) => {
          console.log("请求失败", err);
        });
    },
  },
};
</script>
